package tr.com.netgis.pojo;

import java.util.Hashtable;

import org.ksoap2.serialization.KvmSerializable;
import org.ksoap2.serialization.PropertyInfo;

public class NameValues implements KvmSerializable {

	private String name;
	private String value;

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getValue() {
		return value;
	}

	public void setValue(String value) {
		this.value = value;
	}

	@Override
	public Object getProperty(int index) {
		switch (index) {
		case 0:
			return name;
		case 1:
			return value;
		default:
			return null;
		}
		
	}

	@Override
	public int getPropertyCount() {
		return 2;
	}

	@Override
	public void getPropertyInfo(int index, Hashtable arg1, PropertyInfo info) {
		switch (index) {
		case 0:
			info.type = PropertyInfo.STRING_CLASS;
			info.name = "Name";
			break;
		case 1:
			info.type = PropertyInfo.STRING_CLASS;
			info.name = "Value";			
		default:
			break;
		}
	}

	@Override
	public void setProperty(int index, Object value) {
		switch (index) {
		case 0:
			this.name = value != null ? value.toString() : null;
			break;
		case 1:
			this.value = value != null ? value.toString() : null;
		default:
			break;
		}		
	}

}
